// release/components/chatcard.js
const app = getApp();
Component({
  /**
   * 组件的一些选项
   */
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的属性列表
   */
  properties: {
    chatlist: {
      type: Array,
      observer: function (newVal, oldVal) {
        let len = newVal.length
        var that = this;
        console.log('跳转')
        // let scrollid = newVal[len-1]._id
        setTimeout(function () {
          that.setData({
            scrollid: 'msg-' + parseInt(len-1)
          })
        }, 100)

      }
    }
  },
  lifetimes: {
    attached() {
      var that = this;
      wx.getSystemInfo({
        success: function (res) {
          that.setData({
            systemInfo: res
          })
        }

      })
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    openid: app.globalData.openid || wx.getStorageSync('openid'),
    scrollid: '',
    systemInfo:{}
  },
  /**
   * 组件的方法列表
   */
  methods: {

  }
})